<!DOCTYPE html>
<html lang="zh"
>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>bootdo - 文件管理器</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="shortcut icon" href="favicon.ico">
    <link href="/css/font-awesome.css?v=4.4.0" media="all" rel="stylesheet" type="text/css"/>
    <link href="/css/animate.css" rel="stylesheet">
    <link href="/css/layui.css" rel="stylesheet">
    <link href="/css/style.css?v=4.1.0" rel="stylesheet">
    <title>Krajee JQuery Plugins - &copy; Kartik</title>
    <link href="/css/bootstrap.min-4.0.0.css" rel="stylesheet">
    <link href="/css/fileinput.css" media="all" rel="stylesheet" type="text/css"/>
    <link href="/css/font-awesome.min.css" media="all" rel="stylesheet" type="text/css"/>
    <script src="/js/jquery-3.2.1.min.js"></script>
    <script src="/js/plugins/sortable.js" type="text/javascript"></script>
    <script src="/js/fileinput.js" type="text/javascript"></script>
    <script src="/js/locales/zh.js" type="text/javascript"></script>
    <script src="/themes/explorer-fa/theme.js" type="text/javascript"></script>
    <script src="/themes/fa/theme.js" type="text/javascript"></script>
    <script src="/js/popper.min.js" type="text/javascript"></script>
    <script src="/js/bootstrap.min-4.0.0.js" type="text/javascript"></script>
    <script src="/ruoyi/js/ry-ui.js"></script>

    <script src="/js/layui.js"></script>
    <script src="/js/plugins/layer/layer.min.js"></script>

    <style>
        a:active {
            color: yellow;
        }

        a:hover {
            color: red;
        }
    </style>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content" id="app">
    <div class="container kv-main">

        <form enctype="multipart/form-data" method="POST">
            <div class="form-group">
                <div class="file-loading">
                    <input id="uploadfile" type="file" multiple  data-overwrite-initial="false"
                    >
                </div>
            </div>
            <hr>

        </form>
        <hr>
        <br>
    </div>
</div>
</body>
<script>

    $("#uploadfile").fileinput({
        theme: 'fa',
        language: 'zh',
        uploadUrl: '/system/file/upload', // you must set a valid URL here else you will get an error
        // allowedFileExtensions: ['jpg', 'png', 'gif','csv', 'txt','mp3','mp4','avi'],
        uploadAsync: true, //默认异步上传
        showUpload: true, //是否显示上传按钮
        showRemove: true, //显示移除按钮
        showPreview: true, //是否显示预览
        showCaption: true,//是否显示标题
        // browseClass: "btn btn-primary", //按钮样式
        maxFileCount: 8, //表示允许同时上传的最大文件个数
        enctype: 'multipart/form-data',
        maxFileSize: 512000,
        validateInitialCount: true,
        previewFileIcon: "<i class='glyphicon glyphicon-king'></i>",
        msgFilesTooMany: "选择上传的文件数量({n}) 超过允许的最大数值{m}！",
        slugCallback: function (filename) {
            return filename.replace('(', '_').replace(']', '_');
        }
    });

    $(document).ready(function () {
        $("#test-upload").fileinput({
            'theme': 'fa',
            'showPreview': false,
            'allowedFileExtensions': ['jpg', 'png', 'gif'],
            'elErrorContainer': '#errorBlock'
        });
        $("#kv-explorer").fileinput({
            'theme': 'explorer-fa',
            'uploadUrl': '/system/file/upload',
            overwriteInitial: false,
            initialPreviewAsData: true,
            initialPreview: [],
            initialPreviewConfig: []
        });
        $('#uploadfile').on('fileerror', function (event, data, msg) {

        });
        $("#uploadfile").on("fileuploaded", function (event, data, previewId, index) {
            if (data.filescount > 0) {
                $.operate.saveSuccess(data.response)
            }
        });
        $('#uploadfile').on('fileerror', function (event, data, msg) {
            if (data.filescount > 0) {
                $.operate.saveSuccess(data.response)
            }
        });
    });
</script>
</html>
